<template>
  <div class="login-wrapper">
    <!-- <img @click="pathHome" :src="publicUrls + 'assets/img/doorHomeLogo.svg'" alt="" class="logo-img" />
    <img :src="bannerImg" alt="" class="login-wrapper-img t-image t-image--fit-cover t-image--position-center" /> -->

    <login @weixLogin="weixLogin" @emitregister="modelShow = true" />

    <t-dialog v-model:visible="visible" :confirmBtn="null" :cancelBtn="null">
      <div class="dialog-body">
        <p class="dialog-body-title">微信登录</p>
        <p class="dialog-body-title1">微信扫一扫登录</p>
        <div class="qrCode-box">
          <qrcode-vue value="" :size="192" level="H" />
        </div>
      </div>
    </t-dialog>
    <!-- <footer class="copyright">©{{ currentYear }} 记忆网-永不落幕的展览展示与交流平台</footer> -->
  </div>
</template>
<script lang="ts">
export default {
  name: 'LoginIndex',
};
</script>
<script setup lang="ts">
// @ts-nocheck
import { doorUrl } from '@/utils/minxin';
import { ref } from 'vue';
import { urls } from '@/utils/request/upload';
import QrcodeVue from 'qrcode.vue';
import Login from './components/Login.vue';
import { useRoute, useRouter } from 'vue-router';
import { getBanner } from '@/api/banner/banner';
let currentDate = new Date();
let currentYear = currentDate.getFullYear();
const route = useRoute();
const visible = ref(false);
const router = useRouter();
const modelShow = ref(false);
const type = ref('login');
const bannerImg = ref('');
const init = async () => {
  try {
    let { data } = await getBanner(2, 1000);
    if (data.length > 0) {
      bannerImg.value = urls + data[0].converUrl + '?format/webp';
    }
  } catch {}
};
init();
const pathHome = () => {
  // router.push({ path: '/portal/home' });
};
const switchType = (val: string) => {
  type.value = val;
};
const weixLogin = () => {
  visible.value = true;
};
</script>

<style lang="less" scoped>
@import url('./index.less');
.login-wrapper {
  position: relative;
  :deep(.t-dialog) {
    width: 462px !important;
  }
  .register-dialog {
    :deep(.t-dialog__header) {
      display: flex;
      align-items: center;
      height: 76px;
      padding: 0 32px;
      // box-shadow: inset 0px -1px 0px 0px rgba(0, 0, 0, 0.08);
    }
    :deeep(.t-dialog__body) {
      padding: 0px !important;
      width: 100%;
    }
    :deep(.t-radio-group) {
      display: flex;
      justify-content: space-between;
      width: 100%;
      // padding: 32px;
    }
    :deep(.t-dialog) {
      width: 1088px !important;
      padding: 0;
    }
    :deep(.t-dialog__close) {
      font-size: 24px;
      .t-icon {
        font-size: 24px;
        width: 24px;
        height: 24px;
      }
    }
    :deeep(.t-dialog__body) {
      padding: 0px !important;
      width: 100%;
    }
    :deep(.t-dialog__footer) {
      padding: 0;
    }
  }
}
.dialog-body {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.dialog-body-title {
  font-size: 18px;
  font-family: SourceHanSerifCN-Bold, SourceHanSerifCN;
  font-weight: bold;
  color: #333333;
  line-height: 28px;
}
.dialog-body-title1 {
  font-size: 14px;
  font-family: PingFangSC-Regular, PingFang SC;
  font-weight: 400;
  color: #999999;
  line-height: 22px;
  margin-top: 8px;
  margin-bottom: 24px;
}
.qrCode-box {
  padding: 20px;
  border-radius: 4px;
  border: 1px solid #cfbda8;
}
.login-wrapper-img {
  width: 100%;
  height: 100%;
}
.logo-img {
  cursor: pointer;
  position: fixed;
  top: 80px;
  left: 150px;
  width: 132px;
  height: 60px;
  z-index: 99;
}
:deep(input[type='password']) {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
}
.copyright {
  display: flex;
  justify-content: center;
  left: 0;
  width: 100%;
}
</style>
